﻿<%@ Page Language="VB" MasterPageFile="~/Default.master" Title="Untitled Page" %>


<%@ Register TagPrefix="Club" TagName="LoginBanner" Src="~/UserControls/LoginBanner.ascx" %>
<%@ Register TagPrefix="Club" TagName="ImageThumbnail" Src="~/UserControls/ImageThumbnail.ascx" %>
<%@ Register TagPrefix="Club" TagName="WebContent" Src="~/UserControls/WebContent.ascx" %>


<script runat="server">
      
    Protected Sub pn1_SelectedPageChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        pn2.SelectedPage = pn1.SelectedPage
    End Sub
    
    
    Protected Sub Pn2_SelectedPageChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        pn1.SelectedPage = pn2.SelectedPage
    End Sub
    
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        panel1.Visible = User.IsInRole("Administrators")
    End Sub

    Protected Sub PagedPhotosList_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs)
        Dim pages As Integer = ClubStarterKit.Web.Photos.NumPages()
        pn1.Count = pages
        pn2.Count = pages
    End Sub
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="body">
        <Club:LoginBanner ID="LoginBanner1" runat="server" />
        <div id="columnleft">
            <a name="content_start" id="content_start"></a>
            <div class="leftblock">
            <Club:WebContent ID="WebContent1" runat="server" Section="photos" />
                    <a href="../RSS/AlbumsRss.aspx">
                    <asp:Image ID="Image1" runat="server" SkinID="rss" />
                    </a>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                <a href="../RSS/AlbumsRss.aspx"></a>
            </div>
        </div>

        <div id="columnright">
            <div class="rightblock">
                <asp:ObjectDataSource ID="PagedPhotosList" runat="server" SelectMethod="SelectAlbumList" TypeName="ClubStarterKit.Web.Photos" OnSelected="PagedPhotosList_Selected">
                    <SelectParameters>
                        <asp:ControlParameter Name="pagenum" ControlID="pn1" PropertyName="SelectedPage" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                
                    
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <div class="newscrumbs"><strong>Page</strong>:
                    <Club:PageNumberer ID="pn1" runat="server" DisplayedPages="7" CssClass="PageNumbers"
                        OnSelectedPageChanged="pn1_SelectedPageChanged" />
                </div>
                <div class="dashedline">
                </div>
                <asp:Panel runat="server" ID="panel1">
                    <div class="actionbuttons">
                        <Club:RolloverLink ID="AddBtn" runat="server" Text="New Album" NavigateURL="New.aspx" />
                    </div>
                    <div class="dashedline">
                    </div>
                </asp:Panel>
                <asp:DataList ID="albumlist" runat="server" DataSourceID="PagedPhotosList" RepeatColumns="2">
                    <ItemTemplate>
                        <div class="membercard">
                            <div style="float: left; padding: 0 5px 0 0;">
                                <a href='<%# "contents.aspx?Albumid=" & Cstr( Eval("AlbumID"))%>'>
                                    <Club:ImageThumbnail ID="ImageThumbnail1" runat="server" PhotoID='<%# Eval("DisplayImage") %>' />
                                </a>
                            </div>
                            <h3>
                                <a href='<%# "contents.aspx?Albumid=" &Cstr( Eval("albumID"))%>'>
                                    <asp:Label ID="titleLabel" runat="server" Text='<%# Eval("title") %>' />
                                </a>
                            </h3>
                            <asp:Label ID="privateLabel" runat="server" Text='<p>Private to UserName<p>' Visible='<%# CBool(Eval("isprivate")) %>' />
                            <p>
                                Album contains
                                <asp:Label ID="imagecount" runat="server" Text='<%# Eval("ImageCount") %>' />
                                images.</p>
                            <div class="clearcard">
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:DataList>
                <div class="dashedline">
                </div>
                <div class="newscrumbs">
                    <strong>Page</strong>:
                    <Club:PageNumberer ID="pn2" runat="server" DisplayedPages="7" CssClass="PageNumbers"
                        OnSelectedPageChanged="pn2_SelectedPageChanged" />
                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                    <ProgressTemplate>
                        <br />
                        <asp:Image ID="Image2" runat="server" SkinID="loading" />
                    </ProgressTemplate>
                </asp:UpdateProgress>
                        
            </div>
        </div>
        <div class="clear2column">
        </div>
    </div>
</asp:Content>
